package Bai07;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

public class Fileserver {

	/**
	 * @param args
	 */
	ServerSocket socket;
	Socket con;
	public Fileserver(int port){
		try {
			socket=new ServerSocket(port);
			System.out.println("Server is listening!");
			do {
				con=socket.accept();
				//System.out.print(socket.getInetAddress().getHostName());
				new Threading(con);
			}while(true);
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		new Fileserver(2048);
	}

}
